package stores;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Dao_ObraSocial_Paciente {
	Dao_connection unicaConeccion;
	
	public Dao_ObraSocial_Paciente() {
		super();
		unicaConeccion= Dao_connection.getInstancia();
	}


	public boolean insertarObraSocial_Paciente(int dni, String sigla){
		boolean validar= true;
		try{
			Connection connection = unicaConeccion.getConnection();
			String query = "INSERT INTO Obra_Social_Paciente (#dni,Sigla) VALUES (?,?)";
			PreparedStatement stmt = connection.prepareStatement(query);
			System.out.println(dni);
			stmt.setInt(1,dni);
			stmt.setString(2,sigla);
			
			stmt.execute();
			connection.close();
		}
		catch(SQLException e){
			e.printStackTrace();
			validar=false;
		}
		catch(Exception e){
			e.printStackTrace();
			validar=false;
		}
		return validar;
	}

}

	


	
	
	
	
	
	
	
	
	